package com.quartz.job;

import lombok.extern.slf4j.Slf4j;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.SchedulerException;

import java.time.LocalDateTime;

@Slf4j
public class HelloJob implements Job {

    @Override
    public void execute(JobExecutionContext context) {
        Object tv1 = context.getTrigger().getJobDataMap().get("t1");
        Object tv2 = context.getTrigger().getJobDataMap().get("t2");
        Object jv1 = context.getJobDetail().getJobDataMap().get("j1");
        Object jv2 = context.getJobDetail().getJobDataMap().get("j2");
        Object sv = null;
        try {
            sv = context.getScheduler().getContext().get("skey");
        } catch (SchedulerException e) {
            e.printStackTrace();
        }
        log.info("01--->"+tv1+":"+tv2);
        log.info("02--->"+jv1+":"+jv2);
        log.info("sv--->"+sv);
        log.info("hello:"+LocalDateTime.now());
    }

}
